/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gnupostgressqldesigner;

import gnupostgressqldesigner.window.mainwindow.MainWindow;
import javax.swing.*;
import javax.swing.plaf.metal.*;


/**
 *
 * @author juliano
 */
public class Manager extends javax.swing.JFrame
{
    private static  Manager instance;
    private MainWindow mainWindow;

    private JMenu jMenuFile;
    private JMenu jMenuEdit;
    private JMenu jMenuAbout;
    private JMenuBar jMenuBarMain;
    private JMenuItem jMenuItemOpen;
    private JMenuItem jMenuItemNew;
    private JMenuItem jMenuItemOut;

    private Manager()
    {

    }

    public static Manager getInstance()
    {
        if(instance == null)
            instance = new Manager();
        
        return instance;
    }

    public void start()
    {
       // mainWindow = new MainWindow();
        //mainWindow.show();

        jMenuFile = new JMenu();
        jMenuEdit = new JMenu();
        jMenuAbout = new JMenu();

        jMenuBarMain = new JMenuBar();
        jMenuItemOpen = new JMenuItem();
        jMenuItemNew = new JMenuItem();
        jMenuItemOut = new JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setName("GNU PostgresSQL Designer");
        setResizable(false);

        jMenuBarMain.setName("jMenuBar1");

        jMenuFile.setText("Arquivo");
        jMenuFile.setName("Arquivo");

        jMenuItemOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItemOpen.setText("Abrir");
        jMenuItemOpen.setName("Abrir");
        jMenuFile.add(jMenuItemOpen);

        jMenuItemNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItemNew.setText("Novo");
        jMenuItemNew.setName("Novo");
        jMenuFile.add(jMenuItemNew);

        jMenuItemOut.setText("Sair");
        jMenuItemOut.setName("Sair");
        jMenuFile.add(jMenuItemOut);

        jMenuBarMain.add(jMenuFile);

        jMenuEdit.setText("Editar");
        jMenuEdit.setName("Editar");
        jMenuBarMain.add(jMenuEdit);

        jMenuAbout.setText("Sobre");
        jMenuAbout.setName("Sobre");
        jMenuBarMain.add(jMenuAbout);

        setJMenuBar(jMenuBarMain);

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGap(0, 799, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGap(0, 578, Short.MAX_VALUE)
        );

        try {

            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //Windows
            UIManager.LookAndFeelInfo[] instalados = UIManager.getInstalledLookAndFeels();

             //UIManager.setLookAndFeel(instalados[4].getClassName());
            /*
            com.sun.java.swing.plaf.gtk.GTKLookAndFeel - padrão GTK+
            javax.swing.plaf.metal.MetalLookAndFeel - Metal
            com.sun.java.swing.plaf.windows.WindowsLookAndFeel - Windows
            com.sun.java.swing.plaf.motif.MotifLookAndFeel - Motif
            javax.swing.plaf.mac.MacLookAndFeel - Mac
             * */

         }
        catch(Exception e)
         {
            System.out.println("Deu merda");
         }

        add(new JButton("Butão1"));
        pack();

        setVisible(true);
    }
}
